<?php
include "test2.php";
$param = [
    'money'=>'定投金额',
    'income'=>'单次利率',
    'expected'=>'目标金额',
    'all'=>'存款',
];
echo "<pre>";
var_dump($param);
$money = $_GET['money'];
$income= $_GET['income'];
$expected = $_GET['expected'];

$a= 0;
$all = $_GET['all'];
//$income = $income/12;
$y = $m = 1;
$i= 1;
$draw = [];
do{
    $all = round($all*(1+$income) + $money,2);
    $draw[] = $all;
    $a += $money;
//    echo "第{$y}年{$m}月。 总资金".round($all,3)."元".PHP_EOL;
    echo "第{$i}天。 总资金".$all."元".PHP_EOL;
    echo "总投入{$a}".PHP_EOL;
    $i ++;
}while($all <= $expected);
//var_dump($draw);
//draw($draw);